package com.jgzx.constant.receive;

import cn.hutool.core.util.StrUtil;
import com.jgzx.constant.payment.PaymentTypeEnum;

/**
 * 收款类型
 * @author chenzy
 * @date 2021/7/31 9:24
 **/
public enum ReceiveBillTypeEnum {
    /** QCSK【期初收款】 */
    OPENING_RECEIVE("QCSK", "期初收款"),
    /** ZCSK【正常收款】 */
    NORMAL_RECEIVE("ZCSK", "正常收款"),
    ;
    private final String value;
    private final String showName;

    /**
     * @param value 值
     * @param showName 显示名称
     */
    ReceiveBillTypeEnum(String value, String showName){
        this.value = value;
        this.showName = showName;
    }

    /**
     * 通过收款类型值获取枚举对象
     * @param value 收款类型值
     * @return 收款类型枚举
     */
    public static ReceiveBillTypeEnum getPaymentTypeByValue(String value){
        for(ReceiveBillTypeEnum receiveBillType : ReceiveBillTypeEnum.values()){
            if(StrUtil.equals(value, receiveBillType.value())){
                return receiveBillType;
            }
        }
        return null;
    }

    public String value() {
        return this.value;
    }

    public String showName() {
        return this.showName;
    }
}
